package main;


import io.GeneFileReader;
import io.OverlapsReader;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import util.DifferencesCalculatorNEW;
import util.Translator;


public class TrianglesCreationMain {
	private static Translator tr = new Translator();
	private static DifferencesCalculatorNEW calculator=new DifferencesCalculatorNEW();

	public static void main(String[] args) throws FileNotFoundException,
			IOException {
		//Aquifex aeolicus.ffn 1
		//Archaeoglobus fulgidus.ffn 2
		//Bacillus subtilis.ffn 3
		//Bacteroides thetaiotaomicron.ffn 4
		//Chlamydia muridarum.ffn 5
		//Dehalococcoides ethenogenes.ffn 6
		//Escherichia coli.ffn 7
		//Fusobacterium nucleatum.ffn 8
		//Gloeobacter violaceus.ffn 9
		//Leptospira interrogans.ffn 10
		//Nanoarchaeum equitans.ffn 11
		//Pirellula.ffn 12
		//Rubrobacter xylanophilus.ffn 13
		//Sulfolobus acidocaldarius.ffn 14
		//Thermotoga maritima.ffn 15
		//Thermus thermophilus.ffn 16

		String organism = "16_organisms.ffn";
		GeneFileReader fr = new GeneFileReader(new FileInputStream(new File(
				"organisms/" + organism)));

		//System.out.println(fr.numberOfGenes());

		for (int i=0;i<fr.numberOfGenes();i++){
			calculator.addSequenceUpdate(tr.tripletTranslate(fr.getGeneAt(i)));
		}
		calculator.calculateDifferences();
		calculator.newPrint(organism.substring(0,organism.length()-4)+"_nineMers.csv");

	}
}
